<template>
  <div>
      <div v-for="i in class_list" :key="i.id">
          <h2>详情列表</h2>
          <p>班名:{{i.name}}</p>
          <p v-if="i.num<=30">班级人数:{{i.num}}----{{num11}}</p>
          <p v-else-if="i.num<=50">班级人数:{{i.num}}----{{num22}}</p>
          <p v-else>班级人数:{{i.num}}----{{num33}}</p>
          <p>讲师:{{i.teacher}}</p>
      </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            id:this.$route.query.id,
            class_list:[],
            num11:'小班',
            num22:'中班',
            num33:'大班'
        }
    },created(){
        axios.get('http://127.0.0.1:8000/showclass?id='+this.id).then(resp=>{
            console.log(resp.data)
            this.class_list=resp.data
        }).catch(error=>{
            console.log(error)
        })
    }
}
</script>

<style>

</style>